package dao

import (
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promauto"
)

// 订单创建总量（Counter）：按类型和区域统计
var orderCreatedTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "ride_hailing_order_created_total",
		Help: "Total number of created orders by type and area",
	},
	[]string{"order_type", "area"}, // 标签：订单类型（如快车、专车）、区域
)

// 当前各状态的订单数（Gauge）：按状态和类型统计
var orderStatusCurrent = promauto.NewGaugeVec(
	prometheus.GaugeOpts{
		Name: "ride_hailing_order_status_current",
		Help: "Current number of orders by status and type",
	},
	[]string{"status", "order_type"}, // 标签：状态（pending/accepted/completed/canceled）、类型
)

// 订单状态变更耗时（Histogram）：按原状态→新状态统计
var orderStatusChangeDuration = promauto.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "ride_hailing_order_status_change_seconds",
		Help:    "Duration of order status changes (from one status to another)",
		Buckets: []float64{0.5, 1, 2, 5, 10}, // 状态变更耗时分桶（0.5s/1s/2s等）
	},
	[]string{"from_status", "to_status"}, // 标签：原状态→新状态
)
